// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(21,2) == 0;
	question = "special";
	text1 = "As you ascend into the pass to the Nodye Coast, you soon abandon any idea that you might slip through to the more peaceful lands to the west.";
	text2 = "The pass is blocked by a huge fortification. A massive stone wall, heavily defended by human soldiers and creations, blocks the way. The forces there could turn back a pack of Unbound with little problem.";
	text3 = "The roads up to the keep are also guarded, though more lightly. Patrols of soldiers march up and down, looking for anyone who might be trying to slip through.";
	text4 = "As you look around, a guard peels off from one of the patrols. He looks like he's going to walk forward and question you. He doesn't look friendly.";
	action = SET_SDF 21 2 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(21,6) == 0;
	question = "special";
	text1 = "You enter the concealed rebel tunnel, the route that the enemies of the Shapers have been using to slip people out of the Nodye Coast. It is remarkable that this could be constructed and kept concealed for so long.";
	text2 = "The passage leads to a cavern, a natural opening in the solid stone of the mountain. The ceiling is painfully low. The tunnel leading to it was created by magic. A single, intense burst of heat that left the exposed surfaces melted and smooth.";
	text3 = "This route will not stay undiscovered for long, but the rebels are taking full advantage of it while it exists. Or they will use it, if you can remove whatever is obstructing it.";
	action = SET_SDF 21 6 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to open the trapdoor. It is barred from the other side. Makes sense. When the Shapers find this place, this obstacle will slow them down and give any escapees on the other side time to escape.";

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = gf(22,3) > 0 && get_terrain(30,54) != 0;
	question = "special";
	text1 = "You find the rock protrusion Learned Dominic described to you. You push on it. A narrow section of the cliff face slides away, revealing a narrow passage.";
	code =
		set_terrain(30,54,0);
	break;
	
begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  CREATION STABLES";
	text3 = "  NON-SOLDIERS KEEP OUT!";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  SUPPLY CENTER";
	text3 = "  NON-SOLDIERS KEEP OUT!";
	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This is a member of Elrica's caravan. They are happy to give you a drink and chat with you for a while. It helps break up the tedium of their long stay here.";
	text2 = "You don't learn anything of value, except that the guards farther up the pass are not shy about killing those who overstep their bounds.";

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This fyora is unusually muscular. The scales on its shoulders are worn and cracked, as if it has been yoked to the wagons.";
	text2 = "It must be a new variety, able to not only pull a merchant's cart but defend it if needed.";

begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The creation snarls at you.";	

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "A captain of the Shaper army walks up to greet you. He doesn't look at all friendly. He launches into a speech he has clearly had to give many times.";
	text2 = "_I'm Captain Kellen. The Nodye Pass is closed. Only those with a letter of permission from a general or Councilor can pass through. If you don't have such a letter, you're going to have to turn back._";
	text3 = "He adds, _Spare me all of the bluster and threats and claims that you will get me demoted. No letter, no pass._"; 
	text5 = "Captain Kellen sighs when he realizes that you still want to talk to him. _What do you want? If you don't have a letter from a general or Councilor, you can't pass._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = gf(21,4) == 0;
	question = "I have a letter signed by Councilor Rawal. (Show it to him.)";
	text1 = "He takes the paper, reads it, and hands it back to you. He is clearly impressed. _Not bad. That's far better documentation than most people who come up here have._";
	text2 = "_But those papers are only good for central Terrestia. Rawal doesn't say anything about the Nodye Coast._ He grins. _He probably didn't want you wandering off to anywhere safe._";
	text3 = "_Can't let you by. Sorry._";
	action = SET_SDF 21 4 1;

begintalknode 12;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Why is the pass sealed?";
	text1 = "_Not my business to guess why the Councilors do anything. Think they want to keep any rogue creations slipping through and making the coast as much of a wreck as the rest of Terrestia._";
	text2 = "_It's worked so far._";

begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "So nobody can get through?";
	text1 = "_Not to the west, not without permission. People come through heading east all the time. Mainly soldiers._";
	text2 = "_The Nodye Coast will let people out. Not in._";

begintalknode 14;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Who do you turn away?";
	text1 = "_Mainly merchants and refugees. Makes me sad. Hate sending families back into the mess the Mera-Tev has become. But orders are orders._";

begintalknode 15;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "There is no way I can pass?";
	text1 = "_Not without the right sort of letter, and I'll tell you something. If any of the Councilors are getting you to work for them, you'll never get permission to go west. They know that if you can reach peaceful lands they'll never see you again._";
	text2 = "_To be safe, you should just turn back from here. Go any farther west, and the other soldiers will use more than words to get you to leave._";
	
begintalknode 16;
	state = 10;
	nextstate = -1;
	condition = gf(21,5) == 0 && gf(21,6) > 0;
	question = "Did you know that the rebels have a secret tunnel through here?";
	text1 = "You describe the tunnel to the captain. He is stunned to learn about it. He feels very fortunate that someone would betray the rebels in such a way.";
	text2 = "_We'll take full advantage of this. We won't close it up right away. We'll watch it and find out who the rebels and traitors are. You've done well for the Shapers. I'll make sure my superiors hear about it._";
	code =	
		sf(21,5,1);
		award_party_xp(100,10);
		inc_flag(100,0,3);
	break;

begintalknode 17;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I'll be going, then.";
	text1 = "_Sure you will. Back down the hill and away. Don't want to see you get hurt._";
	action = END_TALK;

begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "One of the pass guards has spotted you. He shouts, _Get out of here! If you're still here on the count of ten, we'll make you leave!_";	

begintalknode 21;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "One of the pass guards has spotted you. He doesn't want a fight, but he has his orders. He shouts an alarm.";
	text2 = "The pass defenses immediately leap to life. You hear yelling coming from all around you. Soon after that, you hear the roars of hunting creations. The Nodye Pass has just become a very unfriendly place.";

begintalknode 25;
	state = -1;
	nextstate = -1;
	condition = get_sdf(21,13) == 0;
	question = "special";
	text1 = "Like the creations to the south, these mines have gone rogue. When you get close, their sensor tendrils immediately point at you and start to quiver.";
	text2 = "The mines to the south look highly explosive and volatile. The mines to the north are smaller and more delicate. Given the choice, the northern mines would be less likely to instantly kill you.";
	action = SET_SDF 21 13 1;

begintalknode 26;
	state = -1;
	nextstate = -1;
	condition = get_sdf(21,14) == 0;
	question = "special";
	text1 = "";

	action = SET_SDF 21 14 1;

begintalknode 27;
	state = -1;
	nextstate = -1;
	condition = get_sdf(21,15) == 0 && get_terrain(27,23) == 0;
	question = "special";
	text1 = "You are confused for a moment, unsure where to enter the secret tunnel from here.";
	text2 = "Then you look at the ground. You see very faint footprints, leading north. The other entrance to the tunnel must be across the road.";
	action = SET_SDF 21 15 1;	
	
begintalknode 28;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The fyora just hisses at you.";
	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "You would guess that this woman is a merchant, and a successful one. Her traveling clothes are expensive and well-tailored, though her weeks stranded in the pass have left them worn and filthy.";
	text2 = "She is currently sitting by the fire, pen in hand, drafting a letter. She occasionally mutters a quiet obscenity.";
	text3 = "When you get close, she looks up at you. She is obviously disappointed by what she sees. _Oh. You're not one of mine._ She sighs. _I'm Elrica. Thought you might have a letter for me._";
	text5 = "Elrica continues to work on her letter. You notice that she has a small stack of messages on the ground next to her, addressed to people all throughout the Mera-Tev.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Who did you think I was?";
	text1 = "_A member of my caravan. I've been sending my people out, one after another, trying to find someone who can get me permission to get my load through. No luck yet._";

begintalknode 32;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Where have you sent your people?";
	text1 = "_The pass keeps. Mera. The settlements on the way. Anywhere where I'm owed a favor and someone might have enough influence to get me through the pass._";

begintalknode 33;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Maybe I can help?";
	text1 = "_These are tough times. I know there are lots of people desperate enough to hire and trust a stranger. I am not there. Yet._";
	text2 = "";

begintalknode 34;
	state = 30;
	nextstate = 32;
	condition = 1;
	question = "Are you trapped here?";
	text1 = "_You're a bright one, aren't you? Left for the coast weeks ago. Got stuck here. Thought my papers were good enough. Turns out, a lieutenant's signature isn't good enough. I need a full general!_";

begintalknode 35;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What are you carrying?";
	text1 = "_Supplies. For Shapers._ She doesn't elaborate.";

begintalknode 36;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Are you sure you won't be stuck here forever?";
	text1 = "_One of these days, a Shaper is going to realize that the stuff he ordered hasn't arrived. He'll ask around. He'll find I'm here. He'll raise hell. A certain smug captain will realize that, yes, someone can get him demoted!_";
	text2 = "_I'm taking steps to shorten my delay, but if I don't succeed? I won't be here forever._";

begintalknode 37;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Do you have anything I can buy?";
	text1 = "_Do I look like a common tinker to you? Everything I carry is for a Shaper. I'm not fool enough to displease him._";

begintalknode 38;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I'll be going then.";
	text1 = "She nods. _Thank you for a bit of company. It's being a long month._ She returns to working on her letter.";
	action = END_TALK;



begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Shresss";
	text1 = "At the end of this section, you are surprised to find a drayk. Drayks are always aligned with the rebels. Understandable, considering that Shapers destroy them on sight.";
	text2 = "This drayk is very old. His scales have faded and bear the marks and scars of many battles. You begin to ask for his help with clearing the tunnel. Then you see the look on his face. He looks at you with cold hatred.";
	text3 = "_I am Shresss,_ he says. _I am in control here. Sssss. I will not go until I am paid. No pay, and the tunnel staysss closed to you._";
	text5 = "Shresss watches you coldly, looking for any sign that you are going to attack him. Fortunately, he'd prefer not to fight you.";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "Why have you sabotaged the tunnel?";
	text1 = "_Sssss! For payment! A reward, for my yearsss of service, before the drakonsss cast me out!_";

	
begintalknode 52;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "You fought for the rebellion!";
	text1 = "_Yessss! I fought with bravery! I was in victories. I fought when all seemed lost, after Southforge Citadel was lost._";
	text2 = "_Once, I even slew a leader of the enemy. I clenched the throat of a Guardian between my teeth, and I showed no mercy. And I was cast aside!_";
	
begintalknode 53;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "What did the drakons do?";
	text1 = "_I was older. I was slow. I wanted payment for fighting. I wanted to rest on my hoard, asss isss my right. And the arrogant drakonsss have no respect for smaller creations. They said I was uselessss. They sent me away with no pay._";
	text2 = "_I looked for a way for revenge. I found it here._";
	text3 = "_Now I will be paid for service or I will die!_";
	code =
		if (gf(21,16) > 0)
			rs(3);
	break;
	
begintalknode 54;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "Why have you betrayed the rebellion?";
	text1 = "_I am not pleased to do what I do. But if our rebellion does not watch out for creationsss, if it surrendersss all to the whim of the drakonsss, it is not right!_";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = gf(21,16) == 0;
	question = "You have to leave here, or you will be killed.";
	text1 = "_Sssss. I believe you. You will kill me. Or another will. But I will not go until I have what is mine._";
	
begintalknode 56;
	state = 50;
	nextstate = 52;
	condition = gf(21,16) == 0;
	question = "What sort of payment do you want?";
	text1 = "_Sssss. I want little now. I am old and beaten down. I want six hundred coinssss. Only. And I go. No fighting. I find a place to grow old and remember when the rebellion had honor._";
	text2 = "You are able to negotiate him down to four hundred coins, but no lower.";
	code =
		if (get_stat(20) < 5)
			rs(2);
	break;

begintalknode 57;
	state = 52;
	nextstate = 50;
	condition = 1;
	question = "All right. Anything to avoid bloodshed. (Pay him.)";
	text1 = "You don't have enough money. He is angry.";
	text2 = "You hand Shresss the coins. The old creature seems genuinely sad. _So it hasss come to thisss. I take no pleasure in this. But I will go soon. Tell your mastersss the way will be clear._";
	code =
		i = 400;
		if (get_stat(20) < 5)
			i = 600;
		if (coins_amount() < i)
			rs(2);
			else {
				rs(1);
				sf(21,16,2);
				change_coins(-1 * i);
				award_party_xp(100,8);
				}
	break;
	
begintalknode 58;
	state = 52;
	nextstate = 50;
	condition = 1;
	question = "I will not pay.";
	text1 = "_Then we are where we were. I will not go. What will you do?_";

begintalknode 59;
	state = 50;
	nextstate = 54;
	condition = get_stat(20) > 7 && gf(21,16) == 0;
	question = "Fine. Stay here. It doesn't matter whether you stay or go. (Lie.)";
	text1 = "Fortunately, you are a skilled liar. The drayk looks very concerned. _Sssss ... What? What do you mean? You are abandoning the tunnel?_";

begintalknode 60;
	state = 54;
	nextstate = -1;
	condition = 1;
	question = "Yes. I am just looking for anything important left behind. The Shapers will find it soon.";
	text1 = "The drayk is not afraid of being killed by the rebels. However, the prospect of fighting a Shaper and possibly being taken over is terrifying. He shakes his head.";
	text2 = "_I knew it would not work. I will not get justice. The drakonsss will rule, and none will ever challenge them. Only they get their way._";
	text3 = "_I will go. Slip into the mountainsss. Now leave me in my shame._ He turns away.";
	action = END_TALK;
	code =
		sf(21,16,3);
		award_party_xp(100,12);
	break;
	

begintalknode 61;
	state = 50;
	nextstate = -1;
	condition = gf(21,16) > 0;
	question = "Are you going soon?";
	text1 = "_I am a creature who isss true to itsss word. Soon I will go. Now leave me to prepare._ He turns away.";
	action = END_TALK;

begintalknode 62;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "You are a traitor to the rebels. You must die.";
	text1 = "_Sssss! I am ready! Kill me! Take me from this rotten rebellion and ungrateful world!_";
	action = END_TALK;
	code =
		set_attitude(1005,10);
	break;
	
begintalknode 63;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "I am leaving now.";
	text1 = "_Fine. I am not sad to see you go._";
	action = END_TALK;


//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "The rebels have juryrigged a secret exit from this tunnel. This lever is hooked up to a series of chains. When pulled, it will slide away painfully thin sections of the cliff face to let people through.";
	text2 = "If you pull the lever, you will be able to reach the next section of the tunnel. When you go outside, however, you may spend some time exposed to possible sighting by the guards.";


begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = get_terrain(26,39) != 0;
	question = "Pull the lever.";
	text1 = "The mechanism was kept oiled and in good repair. The lever drags the chains through their holes with only a soft scraping noise.";
	text2 = "A section of the wall to the north opens, letting in some fresh air. You can hear guards outside.";

	action = END_TALK;
	code =
		set_terrain(26,39,0);
		set_terrain(27,23,0);
	break;
	
begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = get_terrain(26,39) == 0;
	question = "Pull the lever.";
	text1 = "You try to pull the lever, but it doesn't budge. You hear a soft ticking. The mechanism must automatically close on its own when a little time has passed. Clever.";
	action = END_TALK;
	
begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Leave the lever alone.";
	text1 = "You don't do anything.";
	action = END_TALK;
//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		